package com.gitee.l0km.codegen.base;

public class MethodException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7864657936522530951L;

	public MethodException() {
	}

	public MethodException(String message) {
		super(createMessage(message));
	}

	public MethodException(Throwable cause) {
		super(cause);
	}

	public MethodException(String message, Throwable cause) {
		super(message, cause);
	}
	private static final String createMessage(String message){
		  String clazz = Thread.currentThread() .getStackTrace()[2].getClassName();
		  String method = Thread.currentThread() .getStackTrace()[2].getMethodName();
		return String.format("%s in method %s#%s ",message, clazz,method);
		
	}
}
